import { get, post } from '../../utils/request';

export function goodsDetailApi(obj) {
  return get(`goods/${obj.specId}`, obj); //{ specId }
}

export function addCartOrBuy(obj) {
    // POST /rest/api/v6.0/cart
    return post(`cart/`, obj);
}


export function getSpec(obj) {
  //  http://testbbc.leimingtech.com/api/rest/api/v6.0/goods/info?goodsId=1&specIds=1
    return get(`goods/info`, obj);
}

export function couponlistApi(obj) {
    //GET /rest/api/v6.0/store/coupons
  return get(`store/${obj.storeId}/coupons`, obj);
}

// 领券
export function receiveCouponApi(obj) {
  //POST /rest/api/v6.0/store/receive/coupon
  return post('store/receive/coupon', obj);
}

export function favgoods(obj) {
    //POST /rest/api/v6.0/store/favgoods
    return post('store/fav/goods', obj);
}


export function addRecord(obj) {
    //POST /rest/api/v6.0/store/favgoods
    return post(`/member/goods/browse/${obj.goodsId}`, obj);
}

//参加拼团
export function joinGroup(obj) {
    return post('/collage/group/join', obj);
}
//获取商品最新的拼团
export function newGroup(obj) {
  return get(`/collage/group/goods/new/${obj.id}`, obj);
}
//团信息(小窗口)
export function smallGroupDetail(obj) {
  return get(`/collage/group/${obj.id}`, obj);
}